package com.weishi.project.api.ret;

import com.weishi.project.training.domain.TrainingDay;
import io.swagger.annotations.ApiParam;
import lombok.Data;

import java.util.List;

@Data
public class TrainingDataRet {

    @ApiParam(name = "训练日项目Id")
    private Integer trainingDayId;

    @ApiParam(name = "日期")
    private String day;

    @ApiParam(name = "训练周Id")
    private Integer weekId;

    @ApiParam(name = "一级科目")
    private String firstLevel;

    @ApiParam(name = "二级科目")
    private String secondLevel;

    @ApiParam(name = "课时")
    private double classHour;

    @ApiParam(name = "公里数")
    private Integer kilometers;

    @ApiParam(name = "理想公里数")
    private Integer idealKilometers;

    @ApiParam(name = "桨频sr")
    private Integer sr;

    @ApiParam(name = "心率HR")
    private Integer hr;

    @ApiParam(name = "组数")
    private Integer numberGroups;

    @ApiParam(name = "间隙时间/min")
    private Integer gapTime;

    @ApiParam(name = "强度")
    private String strength;

    @ApiParam(name = "评分")
    private double score;

    private List<SportsManAchievement> sportsMans;


    public static TrainingDataRet getInstan(TrainingDay trainingDay) {
        TrainingDataRet ret = new TrainingDataRet();
        ret.setTrainingDayId(trainingDay.getId());
        ret.setDay(trainingDay.getDay());
        ret.setWeekId(trainingDay.getWeekId());
        ret.setFirstLevel(trainingDay.getFirstLevel());
        ret.setSecondLevel(trainingDay.getSecondLevel());
        ret.setClassHour(trainingDay.getClassHour());
        ret.setKilometers(trainingDay.getKilometers());
        ret.setIdealKilometers(trainingDay.getIdealKilometers());
        ret.setSr(trainingDay.getSr());
        ret.setHr(trainingDay.getHr());
        ret.setNumberGroups(trainingDay.getNumberGroups());
        ret.setGapTime(trainingDay.getGapTime());
        ret.setStrength(trainingDay.getStrength());
        ret.setScore(trainingDay.getScore());
        return ret;
    }
}
